#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>

using namespace std;

int main()
{
    double n, cnt = 0;
    string a, b;
    cin >> n >> a >> b;
    for (int i = 0; i < a.size(); i++)
    {
        if (a[i] == b[i])
            ++cnt;
    }
    if (cnt / a.size() >= n)
        puts("yes");
    else
        puts("no");
    return 0;
}